home *** CD-ROM | disk | FTP | other *** search
/ Kompuutteri K-CD 2002 #1 / K-CD_2002-01.iso / Delphi / INSTALL / program files / Borland / Delphi6 / Source / Rtl / Win / SHFolder.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-05-22  |  3.7 KB  |  94 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Run-time Library                 }
  5. {       Win32 API Interface Unit                        }
  6. {                                                       }
  7. {       Copyright (c) 1985-1999, Microsoft Corporation  }
  8. {                                                       }
  9. {       Translator: Borland Software Corporation        }
  10. {                                                       }
  11. {*******************************************************}
  12.  
  13. unit SHFolder;
  14.  
  15. interface
  16.  
  17. uses
  18.   Windows;
  19.  
  20. {$HPPEMIT '#include <shfolder.h>'}
  21.  
  22. {
  23.   functions to get shell special folders/
  24.   shfolder.dll supports these on all platforms including Win95, Win98, NT4 and IE4 shell
  25.  
  26.   all CSIDL values refereed to here are supported natively by shfolder.dll, that is they
  27.   will work on all platforms.
  28. }
  29. const
  30.   CSIDL_PERSONAL = $0005; { My Documents }
  31. {$EXTERNALSYM CSIDL_PERSONAL}
  32.   CSIDL_APPDATA = $001A; { Application Data, new for NT4 }
  33. {$EXTERNALSYM CSIDL_APPDATA}
  34.  
  35.   CSIDL_LOCAL_APPDATA = $001C; { non roaming, user\Local Settings\Application Data }
  36. {$EXTERNALSYM CSIDL_LOCAL_APPDATA}
  37.   CSIDL_INTERNET_CACHE = $0020;
  38. {$EXTERNALSYM CSIDL_INTERNET_CACHE}
  39.   CSIDL_COOKIES = $0021;
  40. {$EXTERNALSYM CSIDL_COOKIES}
  41.   CSIDL_HISTORY = $0022;
  42. {$EXTERNALSYM CSIDL_HISTORY}
  43.   CSIDL_COMMON_APPDATA = $0023; { All Users\Application Data }
  44. {$EXTERNALSYM CSIDL_COMMON_APPDATA}
  45.   CSIDL_WINDOWS = $0024; { GetWindowsDirectory() }
  46. {$EXTERNALSYM CSIDL_WINDOWS}
  47.   CSIDL_SYSTEM = $0025; { GetSystemDirectory() }
  48. {$EXTERNALSYM CSIDL_SYSTEM}
  49.   CSIDL_PROGRAM_FILES = $0026; { C:\Program Files }
  50. {$EXTERNALSYM CSIDL_PROGRAM_FILES}
  51.   CSIDL_MYPICTURES = $0027; { My Pictures, new for Win2K }
  52. {$EXTERNALSYM CSIDL_MYPICTURES}
  53.   CSIDL_PROGRAM_FILES_COMMON = $002b; { C:\Program Files\Common }
  54. {$EXTERNALSYM CSIDL_PROGRAM_FILES_COMMON}
  55.   CSIDL_COMMON_DOCUMENTS = $002e; { All Users\Documents }
  56. {$EXTERNALSYM CSIDL_COMMON_DOCUMENTS}
  57.  
  58.   CSIDL_FLAG_CREATE = $8000; { new for Win2K, or this in to force creation of folder }
  59. {$EXTERNALSYM CSIDL_FLAG_CREATE}
  60.  
  61.   CSIDL_COMMON_ADMINTOOLS = $002f; { All Users\Start Menu\Programs\Administrative Tools }
  62. {$EXTERNALSYM CSIDL_COMMON_ADMINTOOLS}
  63.   CSIDL_ADMINTOOLS = $0030; { <user name>\Start Menu\Programs\Administrative Tools }
  64. {$EXTERNALSYM CSIDL_ADMINTOOLS}
  65.  
  66.   function SHGetFolderPath(hwnd: HWND; csidl: Integer; hToken: THandle; dwFlags: DWord; pszPath: PAnsiChar): HRESULT; stdcall;
  67.   {$EXTERNALSYM SHGetFolderPath}
  68.   function SHGetFolderPathA(hwnd: HWND; csidl: Integer; hToken: THandle; dwFlags: DWord; pszPath: PAnsiChar): HRESULT; stdcall;
  69.   {$EXTERNALSYM SHGetFolderPathA}
  70.   function SHGetFolderPathW(hwnd: HWND; csidl: Integer; hToken: THandle; dwFlags: DWord; pszPath: PAnsiChar): HRESULT; stdcall;
  71.   {$EXTERNALSYM SHGetFolderPathW}
  72.  
  73. type
  74.   PFNSHGETFOLDERPATHA = function(hwnd: HWND; csidl: Integer; hToken: THandle; dwFlags: DWord; pszPath: PAnsiChar): HRESULT; stdcall;
  75.   {$EXTERNALSYM PFNSHGETFOLDERPATHA}
  76.   PFNSHGETFOLDERPATHW = function(hwnd: HWND; csidl: Integer; hToken: THandle; dwFlags: DWord; pszPath: PAnsiChar): HRESULT; stdcall;
  77.   {$EXTERNALSYM PFNSHGETFOLDERPATHW}
  78.   PFNSHGETFOLDERPATH = PFNSHGETFOLDERPATHA;
  79.  
  80.   TSHGetFolderPathA = PFNSHGETFOLDERPATHA;
  81.   TSHGetFolderPathW = PFNSHGETFOLDERPATHW;
  82.   TSHGetFolderPath = TSHGetFolderPathA;
  83.  
  84. implementation
  85.  
  86. const
  87.   SHFolderDll = 'SHFolder.dll';
  88.  
  89. function SHGetFolderPath; external SHFolderDll name 'SHGetFolderPathA';
  90. function SHGetFolderPathA; external SHFolderDll name 'SHGetFolderPathA';
  91. function SHGetFolderPathW; external SHFolderDll name 'SHGetFolderPathW';
  92.  
  93. end.
  94.